<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- 	<xsl:include href="core\layout_empty.xsl"/> -->
	<xsl:include href="core\form.xsl"/>
	<xsl:include href="core\basic_info_template.xsl"/>
	<xsl:include href="core\common_templates.xsl"/>
	<xsl:include href="register.xsl"/>
	<xsl:include href="core\level0.xsl"/>
	
	<xsl:template match="page">
		<xsl:call-template name="page_content"/>
	</xsl:template>
	
	<xsl:template name="page_content">
		<xsl:choose>
			<xsl:when test="need_registring='1'"><xsl:apply-templates select="form[@name='register']"/></xsl:when>
			<xsl:otherwise>
				<table cellpadding="0" cellspacing="0" width="100%" align="center">
					<xsl:choose>
						<xsl:when test="string-length(/page/autherror)>0"><tr><td><xsl:apply-templates select="autherror"/></td></tr></xsl:when>
						<xsl:otherwise>
							<tr><td><xsl:call-template name="page_navbar_detail"/></td></tr>
							<tr>
								<td valign="baseline" class="titlepage"  style="border-bottom-width: 2px; border-bottom-color: {$header_bg}; border-bottom-style: solid; color:{$color_main_first1};">Yacht Details</td>
							</tr>
							<xsl:if test="string-length(//page/links/link/textHTML)>0">
								<xsl:value-of select="//page/links/link/textHTML" disable-output-escaping="yes"/>
							</xsl:if>
							<tr><td><xsl:apply-templates select="vessel_details"/></td></tr>
							<tr><td><xsl:call-template name="page_navbar_detail"/></td></tr>
						</xsl:otherwise>
					</xsl:choose>
				</table>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>

	<xsl:template name="page_navbar_detail">
		<table cellpadding="4" cellspacing="1" width="100%" align="center">
			<tr align="center">
				<td>
					<a class="linkbold" title="Return to Yacht List">
						<xsl:attribute name="href"><xsl:value-of select="//page/view_list_t"/></xsl:attribute>
						<font color="{$color_main_first1}">Return to Yacht List</font>
					</a>
					&#160;&#160;|&#160;
					<xsl:choose>
						<xsl:when test="/page/theme = 1">
							<a href="main.asp?-vessel_basic_info.asp-&amp;vessels_id={/page/vessel_id}&amp;curr_id={//page/curr_id}&amp;vd=1" class="linkbold" title="Yacht ID#{/page/vessel_id} Basic Info">
								<font color="{$color_main_first1}">Yacht Basic Info</font>
							</a>
						</xsl:when>
						<xsl:otherwise>
							<a href="main.asp?-vessel_basic_info.asp-&amp;vessels_id={/page/vessel_id}&amp;curr_id={//page/curr_id}" class="linkbold" title="Yacht ID#{/page/vessel_id} Basic Info"><font color="{$color_main_first1}">Yacht Basic Info</font></a>
						</xsl:otherwise>
					</xsl:choose>
					&#160;&#160;|&#160;
					<font class="imagetitle">Yacht Details</font>&#160;&#160;|&#160;
					<a href="#" title="Print Yacht ID#{/page/vessel_id} Listing" class="linkbold">
						<xsl:choose>
							<xsl:when test="//page/use_own_footer = 1">
								<xsl:attribute name="onClick">
									window.open('<xsl:value-of select="$media_path"/>/brochure_generate_1.asp?vessel_id=<xsl:value-of select="//page/vessel_id"/>&amp;CompanyID=<xsl:value-of select="//page/member_company_id"/>&amp;MemberID=<xsl:value-of select="//page/member_company_id"/>&amp;AccessLevel=<xsl:value-of select="//page/access_level"/>&amp;int_login_id=<xsl:value-of select="//page/login_id"/>&amp;blnPicInlude=<xsl:value-of select="//page/BrochurePreferences/blnPicInclude"/>&amp;blnPrintPageNumbers=<xsl:value-of select="//page/BrochurePreferences/blnPrintPageNumbers"/>&amp;blnPhotos=<xsl:value-of select="//page/BrochurePreferences/blnPhotos"/>&amp;blnNoImage=<xsl:value-of select="//page/BrochurePreferences/blnNoImage"/>&amp;blnOnePage=<xsl:value-of select="//page/BrochurePreferences/blnOnePage"/>&amp;blnQuality=1&amp;blnIncludeLogo=<xsl:value-of select="//page/BrochurePreferences/blnIncludeLogo"/>&amp;blnIncludeContact=5&amp;blnUseHFSpace=<xsl:value-of select="//page/BrochurePreferences/blnUseHFSpace"/>&amp;blnIncludeDetails=<xsl:value-of select="//page/BrochurePreferences/blnIncludeDetails"/>&amp;blnCoverInlude=<xsl:value-of select="//page/BrochurePreferences/blnCoverInlude"/>&amp;blnBrochuresLayOut=<xsl:value-of select="//page/BrochurePreferences/blnBrochuresLayOut"/>&amp;MainProfilePhotoOnly=<xsl:value-of select="//page/BrochurePreferences/blnMainProfileOnly"/>&amp;fldUserFontFace=<xsl:value-of select="//page/BrochurePreferences/blnFontName"/>&amp;fldUserFontSize=<xsl:value-of select="//page/BrochurePreferences/blnFontSize"/>&amp;blnLayout=<xsl:value-of select="//page/BrochurePreferences/blnLayout"/>&amp;intPaperSize=<xsl:value-of select="//page/BrochurePreferences/intPaperSize"/>&amp;OtherSalesman=-2&amp;curr_id=<xsl:value-of select = "//page/curr_id"/>&amp;measure_id=<xsl:value-of select = "//page/measure_id"/>&amp;ph=1&amp;print_full_listing=1&amp;template=1&amp;blnBrochureConsumer=1',null,'height=500,width=700,resizable=yes,scrollbars=yes')
								</xsl:attribute>
							</xsl:when>
							<xsl:otherwise>
								<xsl:attribute name="onClick">
									window.open('<xsl:value-of select="$media_path"/>/brochure_generate_1.asp?vessel_id=<xsl:value-of select="//page/vessel_id"/>&amp;CompanyID=<xsl:value-of select="//page/member_company_id"/>&amp;MemberID=<xsl:value-of select="//page/member_company_id"/>&amp;AccessLevel=<xsl:value-of select="//page/access_level"/>&amp;int_login_id=<xsl:value-of select="//page/login_id"/>&amp;blnPicInlude=<xsl:value-of select="//page/BrochurePreferences/blnPicInclude"/>&amp;blnPrintPageNumbers=<xsl:value-of select="//page/BrochurePreferences/blnPrintPageNumbers"/>&amp;blnPhotos=<xsl:value-of select="//page/BrochurePreferences/blnPhotos"/>&amp;blnNoImage=<xsl:value-of select="//page/BrochurePreferences/blnNoImage"/>&amp;blnOnePage=<xsl:value-of select="//page/BrochurePreferences/blnOnePage"/>&amp;blnQuality=1&amp;blnIncludeLogo=<xsl:value-of select="//page/BrochurePreferences/blnIncludeLogo"/>&amp;blnIncludeContact=<xsl:value-of select="//page/BrochurePreferences/blnIncludeContact"/>&amp;blnUseHFSpace=<xsl:value-of select="//page/BrochurePreferences/blnUseHFSpace"/>&amp;blnIncludeDetails=<xsl:value-of select="//page/BrochurePreferences/blnIncludeDetails"/>&amp;blnCoverInlude=<xsl:value-of select="//page/BrochurePreferences/blnCoverInlude"/>&amp;blnBrochuresLayOut=<xsl:value-of select="//page/BrochurePreferences/blnBrochuresLayOut"/>&amp;MainProfilePhotoOnly=<xsl:value-of select="//page/BrochurePreferences/blnMainProfileOnly"/>&amp;fldUserFontFace=<xsl:value-of select="//page/BrochurePreferences/blnFontName"/>&amp;fldUserFontSize=<xsl:value-of select="//page/BrochurePreferences/blnFontSize"/>&amp;blnLayout=<xsl:value-of select="//page/BrochurePreferences/blnLayout"/>&amp;intPaperSize=<xsl:value-of select="//page/BrochurePreferences/intPaperSize"/>&amp;OtherSalesman=-2&amp;curr_id=<xsl:value-of select = "//page/curr_id"/>&amp;measure_id=<xsl:value-of select = "//page/measure_id"/>&amp;ph=1&amp;print_full_listing=1&amp;template=1&amp;blnBrochureConsumer=1',null,'height=500,width=700,resizable=yes,scrollbars=yes')
								</xsl:attribute>
							</xsl:otherwise>
						</xsl:choose>
						<font color="{$color_main_first1}">Print Listing</font>
					</a>
					&#160;&#160;|&#160;
					<a href="{$root}main.asp?-email_send.asp-&amp;vessel_id={//page/vessel_id}&amp;curr_id={//page/curr_id}&amp;is_my={//page/is_featured_vessel}" class="linkbold" title="Contact {/page/rowset/data/row/col[@name]}"><font color="{$color_main_first1}">Contact Us</font></a>
					<br/>
					<xsl:if test="/page/vessel/show_view_photos_link">
						<a href="#" class="linkbold">
							<xsl:attribute name="title">YACHT ID#<xsl:value-of select="/page/vessel_id"/> has image(s)</xsl:attribute>									
							<xsl:attribute name="onClick">
								window.open('main.asp?-vessel_photos.asp-fvessel_id=<xsl:value-of select="/page/vessel_id"/>',null,'height=500,width=600,resizable=yes,scrollbars=yes')
							</xsl:attribute>
							<font color="{$color_main_first1}">Yacht Photos</font>
						</a>
						<xsl:if test="/page/vessel/show_view_vr_tours_link or /page/vessel/show_view_asf_link">
							&#160;&#160;|&#160;
						</xsl:if>
					</xsl:if>
					<xsl:if test="/page/vessel/show_view_vr_tours_link">
						<a href="#" Title="Yacht ID#{/page/vessel_id} has virtual tour(s)" class="linkbold">
							<xsl:attribute name="onClick">
								window.open('main.asp?-preview_ivr.asp-fvessel_id=<xsl:value-of select="/page/vessel_id"/>',null,'height=500,width=600,resizable=yes,scrollbars=yes')
							</xsl:attribute>
							<font color="{$color_main_first1}">Yacht VR Tour</font>
						</a>
						<xsl:if test="/page/vessel/show_view_asf_link">&#160;&#160;|&#160;</xsl:if>
					</xsl:if>
					<xsl:if test="/page/vessel/show_view_asf_link">
						<a href="#" Title="Yacht ID#{/page/vessel_id} has streaming video(s)" class="linkbold">
							<xsl:attribute name="onClick">
								window.open('main.asp?-preview_asf.asp-fvessel_id=<xsl:value-of select="/page/vessel_id"/>',null,'height=500,width=600,resizable=yes,scrollbars=yes')
							</xsl:attribute>
							<font color="{$color_main_first1}">Yacht Streaming Video</font>
						</a>
					</xsl:if>
				</td>
			</tr>
		</table>
	</xsl:template>

	<xsl:template match="vessel_details">
		<table cellpadding="0" cellspacing="0" width="100%" align="center">
			<tr>
				<td width="80%" valign="top">
					<table cellpadding="0" cellspacing="4" width="100%">
						<tr><td><xsl:apply-templates select="//page/vessel"/></td></tr>
						<xsl:for-each select="rowset[@id='details']/data/group">
							<xsl:variable name="formId" select="col[@name='form_id']"/>
							<tr>
								<td align="left" class="titlebisection">
									<font color="{$color_main_first1}"><xsl:value-of select="group-head/col[@name='form_name']"/></font>
									<xsl:call-template name="divider">
										<xsl:with-param name="color" select="$color_main_first1"/>
									</xsl:call-template>
								</td>
							</tr>
							<xsl:for-each select="row">
								<tr valign="top">
									<td>
										<xsl:for-each select="pictures/picture">
											<xsl:if test = "string-length(image_file)>0">
												&#160;&#160;
												<a href="#">
													<img border="0"> 
														<xsl:attribute name="onClick">
															window.open( 'main.asp?-vessel_photos.asp-fvessel_id=<xsl:value-of select="/page/vessel_id"/>&amp;form_id=<xsl:value-of select="form_id"/>&amp;image_id=<xsl:value-of select="picture_id"/>',null,'height=500,width=600,resizable=yes,scrollbars=yes')
														</xsl:attribute>
														<xsl:attribute name="src"><xsl:value-of select="$media_path"/><xsl:value-of select="image_file" disable-output-escaping="yes"/></xsl:attribute>
														<xsl:attribute name="title"><xsl:value-of select="description" disable-output-escaping="yes"/></xsl:attribute>
													</img>
												</a>
											</xsl:if>
											<xsl:if test="position() = last()"><br/></xsl:if>
										</xsl:for-each>
										<table cellpadding="2" cellspacing="2" width="100%" align="center">
											<tr>
												<td><xsl:value-of select="col[@name='field_value']" disable-output-escaping="yes"/></td>
											</tr>
										</table>
									</td>
								</tr>
							</xsl:for-each>
						</xsl:for-each>
			 		</table>
				</td>
				<td width="20%" valign="top" align="center" bgcolor="{$color_right_info}" class="regtitle">
					<table cellspacing="0" cellpadding="0" border="0" width="100%">
						<tr>
						    <td colspan="2" align="center" bgcolor="{$color_main_first1}" style="color:{$bg_pagecolor};"><strong>Presented By</strong></td>
						</tr>
						<tr>
						    <td colspan="2" align="center"><xsl:if test="//page/broker_info/company_logo != ''">
								<img src="{$media_path}{//page/broker_info/company_logo}" border="0"/></xsl:if>
							</td>
						</tr>
						<tr>
						    <td colspan="2" align="center"><strong><xsl:value-of select="//page/broker_info/company_name"/></strong></td>
						</tr>
						<tr>
							<td valign="top" align="center" colspan="2"><br/><xsl:value-of select="//page/broker_info/company_address"/>
								&#160;
								<xsl:if test="//page/broker_info/company_city != ''">
									<xsl:value-of select="//page/broker_info/company_city"/>,&#160;
								</xsl:if>
								<xsl:if test="//page/broker_info/company_state != ''">
									&#160;<xsl:value-of select="//page/broker_info/company_state"/>
									<xsl:if test="//page/broker_info/company_zip != ''">
										&#160;<xsl:value-of select="//page/broker_info/company_zip"/>
									</xsl:if>
								</xsl:if>
								<xsl:if test="//page/broker_info/company_country != ''">
									&#160;<xsl:value-of select="//page/broker_info/company_country"/>
								</xsl:if>
								<br/><br/>
							</td>
						</tr>
						<xsl:if test="//page/broker_info/company_phone != ''">
							<tr>
								<td align="center">Office&#160;<strong><xsl:value-of select="//page/broker_info/company_phone"/></strong></td>
							</tr>
						</xsl:if>
						<xsl:if test="//page/broker_info/company_fax != ''">
							<tr>
								<td align="center">Fax&#160;<strong><xsl:value-of select="//page/broker_info/company_fax"/></strong></td>
							</tr>
						</xsl:if>
					</table>
					<nobr>
						<xsl:if test="//page/broker_info/company_url != ''">
							<xsl:choose>
								<xsl:when test="contains(//page/broker_info/company_url,'http')">
									&#160;<a href="{//page/broker_info/company_url}" target="_blank" class="linkbrokerbold"><font color="{$color_main_first1}">Visit Our Web Site</font></a><br/>
								</xsl:when>
								<xsl:otherwise>
									&#160;<a href="http://{//page/broker_info/company_url}" target="_blank" class="linkbrokerbold"><font color="{$color_main_first1}">Visit Our Web Site</font></a><br/>							
								</xsl:otherwise>
							</xsl:choose>
						</xsl:if>
					</nobr>
					<a href="{$root}main.asp?-email_send.asp-&amp;vessel_id={//page/vessel_id}&amp;curr_id={//page/curr_id}&amp;is_my={//page/is_featured_vessel}" class="linkbrokerbold"><font color="{$color_main_first1}">Email Us</font></a><br/>
					<br/>
					<xsl:if test="//page/broker_info/broker_id != ''">
						<table cellspacing="0" cellpadding="2" border="0" width="100%">
							<tr>
							    <td colspan="2" align="center" bgcolor="{$color_main_first1}" style="color:{$bg_pagecolor};"><strong>Brokered By</strong></td>
							</tr>
							<tr>
							    <td colspan="2" align="center">
									<xsl:choose>
										<xsl:when test="//page/broker_info/broker_photo != ''">
											<img src="{$media_path}{//page/broker_info/broker_photo}" border="0"/>
										</xsl:when>
										<xsl:otherwise>	
											<img src="{$img_path_templates}/nobroker.gif" border="2" style="border-color:{$color_main_first1};"  hspace="4" vspace="5"/>
										</xsl:otherwise>
									</xsl:choose>
								</td>
							</tr>
							<tr>
								<td colspan="2" align="center"><strong><xsl:value-of select="//page/broker_info/broker_name"/></strong></td>
							</tr>
						</table>
						<table cellspacing="0" cellpadding="1" border="0">
							<xsl:if test="//page/broker_info/broker_home_phone != ''">
									<tr>
										<td>Home</td>
										<td align="left"><strong><xsl:value-of select="//page/broker_info/broker_home_phone"/></strong></td>
									</tr>
							</xsl:if>
							<xsl:if test="//page/broker_info/broker_cell_phone != ''">
								<tr>
									<td>Cell</td>
									<td align="left"><strong><xsl:value-of select="//page/broker_info/broker_cell_phone"/></strong></td>
								</tr>
							</xsl:if>
							<xsl:if test="//page/broker_info/broker_work_phone != ''">
								<tr>
									<td>Office</td>
									<td align="left"><strong><xsl:value-of select="//page/broker_info/broker_work_phone"/></strong></td>
								</tr>
							</xsl:if>
							<xsl:if test="//page/broker_info/broker_fax != ''">
								<tr>
									<td>Fax</td>
									<td align="left"><strong><xsl:value-of select="//page/broker_info/broker_fax"/></strong></td>
								</tr>
							</xsl:if>
						</table>
					</xsl:if>
					<br/>
					<table cellpadding="2" cellspacing="2" align="center">
						<tr>
							<td colspan="2" bgcolor="FFFFFF" align="center" style="border-width: 1px; border-color: C8C8C9; border-style: solid;">
								<a href="{$root}main.asp?-email_send.asp-&amp;vessel_id={//page/vessel_id}&amp;curr_id={//page/curr_id}&amp;is_my={//page/is_featured_vessel}"><img src="{$media_path}\send_email.gif" alt="" vspace="5" width="144" height="34" border="0"/></a>
							</td>
						</tr>
						<xsl:if test="//page/vessel/strInsMes">
							<tr>
								<td colspan="2" bgcolor="FFFFFF" align="center" style="border-width: 1px; border-color: C8C8C9; border-style: solid;">
									<a href="/im-message.aspx?contact_id={VesselInfo/broker-info/row/im_consultant_contact_id}&amp;vessel_id={VesselInfo/vessel}&amp;include_vessel_id=1" onclick="g_contact_id='{VesselInfo/broker-info/row/im_consultant_contact_id}';g_vessel_id={VesselInfo/vessel};return OpenMessageWindow();" title="Ask online consultant for details" target="_blank"><img src="{$media_path}\chat-on-line.gif" alt="" width="138" height="38" hspace="5" vspace="5" border="0"/></a>
								</td>
							</tr>
						</xsl:if>
						<xsl:if test="string-length(//page/vessel/strSkype) > 0">
							<tr>
								<td colspan="2" bgcolor="ffffff" align="center" style="border-width: 1px; border-color: C8C8C9; border-style: solid;">
									<script type="text/javascript" src="http://download.skype.com/share/skypebuttons/js/skypeCheck.js"></script>
									<a href="skype:{//page/vessel/strSkype}?call"><img src="{$media_path}\skype.gif" alt="Call me!" width="124" height="52" border="0"/></a>
								</td>
							</tr>
						</xsl:if>
					</table>
				</td>
			</tr>
		</table>
	</xsl:template>

	<xsl:template match="vessel">
 		<xsl:call-template name="vessel_basic_info"/>
	</xsl:template>
</xsl:stylesheet>
